#pragma once

#include <string>
#include "CG_location.h"
#include "CG_toggle_vector.h"


using std::string;


const long FF_UNDEFINED = -1;


class CG_flip_flop
{
	private:
		long ID;
		static short R;
		string name;
		CG_location my_loc;
		CG_toggle_vector toggle_vec;
	public:
		CG_flip_flop();
		CG_flip_flop(const unsigned long new_ID, const float loc_x, const float loc_y, const char *vector, const string& name);
		CG_flip_flop(const unsigned long new_ID, const float loc_x, const float loc_y, const string& name);
		CG_flip_flop(const CG_flip_flop& ff); 
		~CG_flip_flop();
		CG_flip_flop& operator=(const CG_flip_flop& new_ff);
		long get_ID();
		bool set_ID(const long new_ID);
		bool init_vector(const char *vector);
		float get_loc_x();
		float get_loc_y();
		bool set_loc(const float x, const float y);
		bool set_loc(CG_location& loc);
		float get_distance(const float x, const float y);
		float get_distance(const CG_location& loc);
		long get_next_toggle(long);
		TOGGLE_BIN operator[](long);
		long get_vector_length();
		long get_num_toggles();
		long get_toggle_vector_num_elements();
		const string& get_name(); 
		static void set_radius(short radius) { CG_flip_flop::R = radius; }
		static const short CG_flip_flop::get_radius() { return CG_flip_flop::R; }
		CG_toggle_vector operator&(CG_flip_flop& ff);
		CG_toggle_vector operator|(CG_flip_flop& ff);
		CG_toggle_vector operator^(CG_flip_flop& ff);
};
